<%@Page Language="C#" MasterPageFile="~/AdminForms/AdminHeaderFooter.master" AutoEventWireup="true" CodeFile="frmAdmin_Drug.aspx.cs" Inherits="frmAdmin_Drug" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/AdminForms/AdminHeaderFooter.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminHeaderFooter" Runat="Server">
<%--<form id="addeditmasterdrug" method="post" runat="server">--%>
<div style="padding-top:110px;">
<h3 class="margin" align="left"><asp:Label ID="lblH2" runat="server"></asp:Label></h3>

<script language = "javascript" type = "text/javascript">
function GetControl()
 {
      
      document.forms(0).submit();  
 }
 function EnabDisabButton(QueryString) {
     var btnadddose = document.getElementById("<%=btnAddDose.ClientID%>");
     var btnaddfrequency = document.getElementById("<%=btnAddFrequency.ClientID%>");
    if(document.getElementById("<%=txtDrugName.ClientID%>").value!="") {
        if (btnadddose != null && btnaddfrequency != null) {
            btnadddose.disabled = true;
            btnaddfrequency.disabled = true;
        }
        //alert("not blank");
//        document.getElementById("<%=btnAddDose.ClientID%>").disabled=true;
//        document.getElementById("<%=btnAddFrequency.ClientID%>").disabled=true;
        //var coun2
        //for (count2 = 0 ; count2 < document.getElementById("<%=lstFrequency.ClientID%>").options.length ; count2++)
        //{
        //    document.getElementById("<%=lstFrequency.ClientID%>").remove (count2);
       // }
     }
    else
     {
         var count;
         
        count=document.getElementById("<%=lstGeneric.ClientID%>").options.length;
        if(count<2)
        {
            if(QueryString=="Edit")
            {
                //alert(QueryString)
                if (btnadddose != null && btnaddfrequency != null) {
                    btnadddose.disabled = true;
                    btnaddfrequency.disabled = true;
                }
//                document.getElementById("<%=btnAddDose.ClientID%>").disabled=true;
//                document.getElementById("<%=btnAddFrequency.ClientID%>").disabled=true;
            }
//            document.getElementById("<%=btnAddDose.ClientID%>").disabled=false;
//            document.getElementById("<%=btnAddFrequency.ClientID%>").disabled=false;
        }
        else {
            if (btnadddose != null && btnaddfrequency != null) {
                btnadddose.disabled = true;
                btnaddfrequency.disabled = true;
            }
//            document.getElementById("<%=btnAddDose.ClientID%>").disabled=true;
//            document.getElementById("<%=btnAddFrequency.ClientID%>").disabled=true;
        }
     }
 }
</script>  

<div class="border center formbg"><br/>
<table cellspacing="6" cellpadding="0" width="100%" border="0">
  <tbody>
    <tr>
    <td  class="form" style="width: 50%; height: 141px">
 
    <label   class="right30" >Drug type :</label>
        <asp:DropDownList ID="ddDrugTypeID" Height="90px" runat="server" OnSelectedIndexChanged="ddDrugType_SelectedIndexChanged" AutoPostBack="True">
        </asp:DropDownList>
     <br/><br />
     <label class="right30">Trade name :</label>
            <asp:textbox id="txtDrugName" runat="server" ></asp:textbox>  
              
    <br/><br />
    <label class="right30">Drug abbreviation :</label><asp:textbox id="txtDrugAbbre" ReadOnly="true"  runat="server"></asp:textbox>
    </td>
      
    <td class="border center pad5 whitebg" style="width: 50%; height: 141px">
    <label class="right30">Generic name :</label>
        <asp:ListBox ID="lstGeneric" runat="server" Height = "100px" Width="300px" ></asp:ListBox><br />
        <asp:Button ID="btnAddGeneric" runat="server" Text="Add Generic Drug" OnClick="btnAddGeneric_Click"/>
        
    </td>
   </tr>
   
   <tr >
        
        <td class="border center pad5 whitebg" style="width: 50%"  >
         <div id="arvShow" runat = "server"  > 
            <label class="Center">Available Strengths  </label><br />
            <asp:ListBox ID="lstStrength"  runat="server" Height = "100px" Width="300px"></asp:ListBox><br />
            <asp:Button ID="btnAddDose" runat="server" Text="Add Strengths" OnClick="btnAddDose_Click"/>
        </div>
        </td>
         <td id="FrequencyID"  class="border center pad5 whitebg"  style="width: 50%" runat="server">
        <div id="arvShow1"  runat = "server"> 
            <label  class="center">Available Frequency</label><br />
            <asp:ListBox ID="lstFrequency"  runat="server" Height = "100px" Width="300px"></asp:ListBox><br />
            <asp:Button ID="btnAddFrequency" runat="server" Text="Add Frequency" Enabled="false" OnClick="btnAddFrequency_Click"/>
        </div> 
        </td> 
    </tr> 
     <tr >
        
        <td class="border center pad5 whitebg" style="width: 50%"  >
         <div id="vaccshow" runat = "server" > 
            <label class="Center">Available Schedule Times  </label><br />
            <asp:ListBox ID="lstshedule"  runat="server" Height = "100px" Width="300px"></asp:ListBox><br />
            <asp:Button ID="btnAddshedule" runat="server" Text="Add Times" 
                 onclick="btnAddshedule_Click" />
        </div>
        </td>
         <td id="Td1"   class="border center pad5 whitebg"  style="width: 50%">
        
        </td> 
    </tr> 
    <tr>
    <td class="border center pad5 whitebg" width="100%" colspan="2">
    <div id ="divStatus" runat ="server" style ="display:inline" >
        <label class="margin">Status :</label> <asp:DropDownList ID="ddStatus" runat="server">
            <asp:ListItem Value="0">Active</asp:ListItem>
            <asp:ListItem Value="1">InActive</asp:ListItem>
        </asp:DropDownList>
    </div>
    </td>
    </tr>
    
   

</tbody></table>
<table>
<tbody>
<tr>
<td class="pad5 center" >

   <asp:Button ID="btnSave" runat="server" Text = "Save" OnClick="btnSave_Click" />
    <asp:Button ID="btnCancel" runat="server" Text = "Close" OnClick="btnCancel_Click"/>
   <asp:Button ID="btn" runat="server" CssClass = "textstylehidden" Text="OK" OnClick="btn_Click" />
</td></tr></tbody>
</table><br />

<!-- Rupesh 20-Jun-07 -->
        <table>
        <tr>
        <td width="100%" colspan="2">
                <div id="nonARVShow1"  runat = "server">
             
                </div>
        </td>
             </tr>
        </table>        

</div>  
</div>
</asp:Content>

